/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.sql.ResultSet;

//import net.proteanit.sql.DbUtils;

import connectivity.QueryManager;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import java.text.DateFormat;
import javax.swing.table.*;

import java.text.SimpleDateFormat;
import java.util.Date;


import javax.swing.JFrame;

import javax.swing.JOptionPane;


import main.BarApplication;
import model.DbUtils;
import model.Member;

/**
 *
 * @author Home
 */
public class MemberOverview extends javax.swing.JPanel {

    /**
     * Creates new form LedenManager
     */
    private LoginScreen login;
    ResultSet rs = null;
    int Id;
    JFrame frame = new JFrame("Wijziging Formulier");

    public void ParentCloseMe() {
        // Hide the frame
        frame.setVisible(false);
        // If the frame is no longer needed, call dispose
        frame.dispose();

    }

    /**
     * Creates new form LedenManager
     */
    public MemberOverview(LoginScreen login) {
        initComponents();
         this.login = login;
        Update_table();

    }
    /*
     private void doubleclick(){
     jTable1.addMouseListener(new MouseAdapter() {
     @Override
     public void mouseClicked(MouseEvent e) {
     if (e.getClickCount() == 2) {
          
     int row = jTable1.getSelectedRow();
     String Table_click = (jTable1.getModel().getValueAt(row, 0).toString());
     int memberId = Integer.parseInt(Table_click);
     System.out.println(memberId);
     // JTable target = (JTable)e.getSource();
     //int row = target.getSelectedRow();
     //int column = target.getSelectedColumn();
     // do some action
     }
     }
     });
     }
     */

    public Member setId(int Id) {
        int row = jTable1.getSelectedRow();
        String Table_click = (jTable1.getModel().getValueAt(row, 0).toString());
        this.Id = Integer.parseInt(Table_click);
        Member member = BarApplication.getQueryManager().getMember(Id);
        return member;
    }

    public int getId() {
        return Id;
    }

    private void Update_table() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable1.setModel(DbUtils.resultSetToTableModel(queryManager.MemberList(rs)));
        jTable1.setAutoCreateRowSorter(true);

    }
    //method om voor een lid zoekopdracht een tabel te creeeren.

    private void updateTableZoekLid(int search) {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable1.setModel(DbUtils.resultSetToTableModel(queryManager.memberListSearchResult(search)));
        jTable1.setAutoCreateRowSorter(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        Add_BTN = new javax.swing.JButton();
        Edit_BTN = new javax.swing.JButton();
        ActiveVervers = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jTextFieldIdSearch = new javax.swing.JTextField();
        jButtonZoekLid = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false;
            }
        }
        ;
        jPanel5 = new javax.swing.JPanel();
        home = new javax.swing.JLabel();
        leden1 = new javax.swing.JLabel();
        activiteit1 = new javax.swing.JLabel();
        bar1 = new javax.swing.JLabel();
        factuur1 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(255, 255, 255));

        jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        jLabel7.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(4, 54, 128));
        jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-article.png"))); // NOI18N
        jLabel7.setText("Leden Manager");

        Add_BTN.setBackground(new java.awt.Color(255, 255, 255));
        Add_BTN.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        Add_BTN.setText("Nieuw  ");
        Add_BTN.setToolTipText("");
        Add_BTN.setBorder(null);
        Add_BTN.setMaximumSize(new java.awt.Dimension(103, 41));
        Add_BTN.setMinimumSize(new java.awt.Dimension(103, 41));
        Add_BTN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Add_BTNActionPerformed(evt);
            }
        });

        Edit_BTN.setBackground(new java.awt.Color(255, 255, 255));
        Edit_BTN.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/edit-icon.png"))); // NOI18N
        Edit_BTN.setText("Wijzig  ");
        Edit_BTN.setBorder(null);
        Edit_BTN.setMaximumSize(new java.awt.Dimension(103, 41));
        Edit_BTN.setMinimumSize(new java.awt.Dimension(103, 41));
        Edit_BTN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Edit_BTNActionPerformed(evt);
            }
        });

        ActiveVervers.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-clear.png"))); // NOI18N
        ActiveVervers.setText("Ververs");
        ActiveVervers.setBorder(null);
        ActiveVervers.setMaximumSize(new java.awt.Dimension(103, 41));
        ActiveVervers.setMinimumSize(new java.awt.Dimension(103, 41));
        ActiveVervers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ActiveVerversActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(190, Short.MAX_VALUE)
                .addComponent(ActiveVervers, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Add_BTN, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Edit_BTN, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(Add_BTN, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(ActiveVervers, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addComponent(Edit_BTN, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(15, 15, 15))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 92, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel7)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBackground(new java.awt.Color(153, 153, 153));
        jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        jTextFieldIdSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldIdSearchActionPerformed(evt);
            }
        });

        jButtonZoekLid.setText("Search");
        jButtonZoekLid.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonZoekLidActionPerformed(evt);
            }
        });

        jLabel8.setText("Vul ID nummer in");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addComponent(jLabel8)
                .addGap(30, 30, 30)
                .addComponent(jTextFieldIdSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButtonZoekLid)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldIdSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonZoekLid)
                    .addComponent(jLabel8))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable1MouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        home.setText("Home");
        home.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        home.setFocusCycleRoot(true);
        home.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                homeMouseClicked(evt);
            }
        });

        leden1.setText("Leden");
        leden1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        leden1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                leden1MouseClicked(evt);
            }
        });

        activiteit1.setText("Activiteit");
        activiteit1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        activiteit1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                activiteit1MouseClicked(evt);
            }
        });

        bar1.setText("Bar");
        bar1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        bar1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bar1MouseClicked(evt);
            }
        });

        factuur1.setText("Factuur");
        factuur1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        factuur1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                factuur1MouseClicked(evt);
            }
        });

        jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Apps-session-logout-icon.png"))); // NOI18N
        jLabel9.setText("logout");
        jLabel9.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel9MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(home)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(leden1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(activiteit1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(factuur1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bar1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel9)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(20, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(home)
                    .addComponent(leden1)
                    .addComponent(activiteit1)
                    .addComponent(bar1)
                    .addComponent(factuur1))
                .addContainerGap())
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel9)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonZoekLidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonZoekLidActionPerformed
        int search = Integer.parseInt(jTextFieldIdSearch.getText());
        updateTableZoekLid(search);
    }//GEN-LAST:event_jButtonZoekLidActionPerformed

    private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked


    }//GEN-LAST:event_jTable1MouseClicked

    private void Edit_BTNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Edit_BTNActionPerformed
        // TODO add your handling code here:

        try {


            //* frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            AddSubscribeMember inschrijving = new AddSubscribeMember(login);
            frame.getContentPane().add(inschrijving);

            // centering the JFrame on screen

            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            Dimension frameSize = getSize();
            if (frameSize.height > screenSize.height) {
                frameSize.height = screenSize.height;
            }
            if (frameSize.width > screenSize.width) {
                frameSize.width = screenSize.width;
            }
            frame.setLocation((screenSize.width - frameSize.width) / 2, 0);

            //frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height)/2 );

            int row = jTable1.getSelectedRow();
            String Table_click = (jTable1.getModel().getValueAt(row, 0).toString());
            int memberId = Integer.parseInt(Table_click);

            Member member = BarApplication.getQueryManager().getMember(memberId);
            if (!(member == null)) {

                //Aangeven dat AddSubscribeMember in edit mode moet
                inschrijving.nieuwLid = false;

                //checkboxen vullen:


                if ("man".equals(member.getGender())) {
                    inschrijving.jCheckBox_Man.setSelected(true);
                } else {
                    inschrijving.jCheckBox_Vrouw.setSelected(true);
                }

                if (1 == (member.getVestigingID())) {
                    inschrijving.jCheckBox_Loc1.setSelected(true);
                }
                if (2 == (member.getVestigingID())) {
                    inschrijving.jCheckBox9_Loc2.setSelected(true);
                }
                if (3 == (member.getVestigingID())) {
                    inschrijving.jCheckBox_Loc3.setSelected(true);
                }

                if (2 == member.getAbonnement()) {
                    inschrijving.jCheckBox3_AboWkDg.setSelected(true);
                }
                if (1 == member.getAbonnement()) {
                    inschrijving.jCheckBox5_AboVol.setSelected(true);
                }
                if (member.getStatus()) {
                    inschrijving.jCheckBoxStatusActief.setSelected(true);
                } else {
                    inschrijving.jCheckBoxStatusNietActief.setSelected(true);
                }



                //DateFormat df = DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.getDefault());


                inschrijving.jTextField_MemberId.setText(Table_click);
                inschrijving.jTextField_voornaam.setText(member.getFirstname());
                inschrijving.jTextField_Tussenvoegsel.setText(member.getMiddlename());
                inschrijving.jTextField_Achternaam.setText(member.getLastname());


                SimpleDateFormat dateFormatJaar = new SimpleDateFormat("yyyy");
                SimpleDateFormat dateFormatMaand = new SimpleDateFormat("MM");
                SimpleDateFormat dateFormatDag = new SimpleDateFormat("dd");
                int jaarGeboorteDatumLid;
                int maandGeboorteDatumLid;
                int dagGeboorteDatumLid;

                DateFormat formatter;
                Date geboorteDatum;
                formatter = new SimpleDateFormat("yyyy-MM-dd");
                geboorteDatum = (Date) formatter.parse(member.getBirthday());
                jaarGeboorteDatumLid = Integer.parseInt(dateFormatJaar.format(geboorteDatum));
                maandGeboorteDatumLid = Integer.parseInt(dateFormatMaand.format(geboorteDatum));
                dagGeboorteDatumLid = Integer.parseInt(dateFormatDag.format(geboorteDatum));

                inschrijving.jComboBox_Jaar.setSelectedItem(Integer.toString(jaarGeboorteDatumLid));
                inschrijving.jComboBox_Maand.setSelectedItem(Integer.toString(maandGeboorteDatumLid));
                inschrijving.jComboBox_Dag.setSelectedItem(Integer.toString(dagGeboorteDatumLid));
                inschrijving.jTextField_StraatHnr.setText(member.getAddress());
                inschrijving.jTextField_Postcode.setText(member.getZip_code());
                inschrijving.jTextField_woonplaats.setText(member.getResidence());
                inschrijving.jTextField_Telnr.setText(member.getTelephoneNumber());
                inschrijving.jTextField_MobielNr.setText(member.getMobilePhone());
                inschrijving.jTextField_Email.setText(member.getEmail());
                inschrijving.jTextField_Rekeningnummer.setText(member.getBankAccount());

            } else {
                JOptionPane.showMessageDialog(this,
                        "Selecteer een lid",
                        "Course Details", JOptionPane.ERROR_MESSAGE);
            }
            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);

        } catch (Exception ex) {
            JOptionPane.showMessageDialog(this,
                    "Selecteer een lid",
                    "Course Details", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_Edit_BTNActionPerformed

    private void Add_BTNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Add_BTNActionPerformed

        AddSubscribeMember inschrijving = new AddSubscribeMember(login);
        frame.getContentPane().add(inschrijving);
        inschrijving.jCheckBoxStatusActief.setSelected(true);


        frame.pack();
        frame.setVisible(true);
        // JOptionPane.showMessageDialog(null, new Inschrijf_Formulier(), "Inschrijf Formulier", JOptionPane.OK_CANCEL_OPTION);
    }//GEN-LAST:event_Add_BTNActionPerformed

    private void ActiveVerversActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ActiveVerversActionPerformed
        Update_table();
    }//GEN-LAST:event_ActiveVerversActionPerformed

    private void jTextFieldIdSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldIdSearchActionPerformed
        int search = Integer.parseInt(jTextFieldIdSearch.getText());
        updateTableZoekLid(search);
    }//GEN-LAST:event_jTextFieldIdSearchActionPerformed

    private void homeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeMouseClicked
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new Home(login));
    }//GEN-LAST:event_homeMouseClicked

    private void leden1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_leden1MouseClicked
        BarApplication.getInstance().showPanel(new MemberOverview(login));
    }//GEN-LAST:event_leden1MouseClicked

    private void activiteit1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_activiteit1MouseClicked

            BarApplication.getInstance().showPanel(new GroupActivityOverview(login));
        
    }//GEN-LAST:event_activiteit1MouseClicked

    private void bar1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bar1MouseClicked

        if (evt != null) {
            BarApplication.getInstance().showPanel(new shopping_bar(login));
        }
    }//GEN-LAST:event_bar1MouseClicked

    private void factuur1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_factuur1MouseClicked
        if (evt != null) {
            BarApplication.getInstance().showPanel(new FactuurOverview(login));
        }
    }//GEN-LAST:event_factuur1MouseClicked

    private void jLabel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel9MouseClicked
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new LoginScreen());
    }//GEN-LAST:event_jLabel9MouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton ActiveVervers;
    private javax.swing.JButton Add_BTN;
    private javax.swing.JButton Edit_BTN;
    private javax.swing.JLabel activiteit1;
    private javax.swing.JLabel bar1;
    private javax.swing.JLabel factuur1;
    private javax.swing.JLabel home;
    private javax.swing.JButton jButtonZoekLid;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    public javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    public javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextFieldIdSearch;
    private javax.swing.JLabel leden1;
    // End of variables declaration//GEN-END:variables
}
